3.443 \(\int \frac{\tan ^3(c+d x)}{a+b \sin ^2(c+d x)} \, dx\)

Optimal. Leaf size=64 \[ \frac{\sec ^2(c+d x)}{2 d (a+b)}-\frac{a \log \left (a+b \sin ^2(c+d x)\right )}{2 d (a+b)^2}+\frac{a \log (\cos (c+d x))}{d (a+b)^2} \]

[Out]

(a*Log[Cos[c + d*x]])/((a + b)^2*d) - (a*Log[a + b*Sin[c + d*x]^2])/(2*(a + b)^2*d) + Sec[c + d*x]^2/(2*(a + b
)*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0757577, antiderivative size = 64, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.087, Rules used = {3194, 77} \[ \frac{\sec ^2(c+d x)}{2 d (a+b)}-\frac{a \log \left (a+b \sin ^2(c+d x)\right )}{2 d (a+b)^2}+\frac{a \log (\cos (c+d x))}{d (a+b)^2} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^3/(a + b*Sin[c + d*x]^2),x]

[Out]

(a*Log[Cos[c + d*x]])/((a + b)^2*d) - (a*Log[a + b*Sin[c + d*x]^2])/(2*(a + b)^2*d) + Sec[c + d*x]^2/(2*(a + b
)*d)

Rule 3194

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = Free
Factors[Sin[e + f*x]^2, x]}, Dist[ff^((m + 1)/2)/(2*f), Subst[Int[(x^((m - 1)/2)*(a + b*ff*x)^p)/(1 - ff*x)^((
m + 1)/2), x], x, Sin[e + f*x]^2/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rubi steps

\begin{align*} \int \frac{\tan ^3(c+d x)}{a+b \sin ^2(c+d x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x}{(1-x)^2 (a+b x)} \, dx,x,\sin ^2(c+d x)\right )}{2 d}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{1}{(a+b) (-1+x)^2}+\frac{a}{(a+b)^2 (-1+x)}-\frac{a b}{(a+b)^2 (a+b x)}\right ) \, dx,x,\sin ^2(c+d x)\right )}{2 d}\\ &=\frac{a \log (\cos (c+d x))}{(a+b)^2 d}-\frac{a \log \left (a+b \sin ^2(c+d x)\right )}{2 (a+b)^2 d}+\frac{\sec ^2(c+d x)}{2 (a+b) d}\\ \end{align*}

Mathematica [A]  time = 0.093298, size = 52, normalized size = 0.81 \[ \frac{(a+b) \sec ^2(c+d x)+a \left (2 \log (\cos (c+d x))-\log \left (a+b \sin ^2(c+d x)\right )\right )}{2 d (a+b)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^3/(a + b*Sin[c + d*x]^2),x]

[Out]

(a*(2*Log[Cos[c + d*x]] - Log[a + b*Sin[c + d*x]^2]) + (a + b)*Sec[c + d*x]^2)/(2*(a + b)^2*d)

________________________________________________________________________________________

Maple [A]  time = 0.078, size = 66, normalized size = 1. \begin{align*}{\frac{a\ln \left ( \cos \left ( dx+c \right ) \right ) }{ \left ( a+b \right ) ^{2}d}}+{\frac{1}{2\,d \left ( a+b \right ) \left ( \cos \left ( dx+c \right ) \right ) ^{2}}}-{\frac{a\ln \left ( b \left ( \cos \left ( dx+c \right ) \right ) ^{2}-a-b \right ) }{2\, \left ( a+b \right ) ^{2}d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^3/(a+sin(d*x+c)^2*b),x)

[Out]

a*ln(cos(d*x+c))/(a+b)^2/d+1/2/d/(a+b)/cos(d*x+c)^2-1/2/d*a/(a+b)^2*ln(b*cos(d*x+c)^2-a-b)

________________________________________________________________________________________

Maxima [A]  time = 1.00768, size = 111, normalized size = 1.73 \begin{align*} -\frac{\frac{a \log \left (b \sin \left (d x + c\right )^{2} + a\right )}{a^{2} + 2 \, a b + b^{2}} - \frac{a \log \left (\sin \left (d x + c\right )^{2} - 1\right )}{a^{2} + 2 \, a b + b^{2}} + \frac{1}{{\left (a + b\right )} \sin \left (d x + c\right )^{2} - a - b}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*sin(d*x+c)^2),x, algorithm="maxima")

[Out]

-1/2*(a*log(b*sin(d*x + c)^2 + a)/(a^2 + 2*a*b + b^2) - a*log(sin(d*x + c)^2 - 1)/(a^2 + 2*a*b + b^2) + 1/((a
+ b)*sin(d*x + c)^2 - a - b))/d

________________________________________________________________________________________

Fricas [A]  time = 2.25925, size = 193, normalized size = 3.02 \begin{align*} -\frac{a \cos \left (d x + c\right )^{2} \log \left (-b \cos \left (d x + c\right )^{2} + a + b\right ) - 2 \, a \cos \left (d x + c\right )^{2} \log \left (-\cos \left (d x + c\right )\right ) - a - b}{2 \,{\left (a^{2} + 2 \, a b + b^{2}\right )} d \cos \left (d x + c\right )^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*sin(d*x+c)^2),x, algorithm="fricas")

[Out]

-1/2*(a*cos(d*x + c)^2*log(-b*cos(d*x + c)^2 + a + b) - 2*a*cos(d*x + c)^2*log(-cos(d*x + c)) - a - b)/((a^2 +
 2*a*b + b^2)*d*cos(d*x + c)^2)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\tan ^{3}{\left (c + d x \right )}}{a + b \sin ^{2}{\left (c + d x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**3/(a+b*sin(d*x+c)**2),x)

[Out]

Integral(tan(c + d*x)**3/(a + b*sin(c + d*x)**2), x)

________________________________________________________________________________________

Giac [B]  time = 1.60109, size = 316, normalized size = 4.94 \begin{align*} -\frac{\frac{a \log \left (a - \frac{2 \, a{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac{4 \, b{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac{a{\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}{a^{2} + 2 \, a b + b^{2}} - \frac{2 \, a \log \left ({\left | -\frac{\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right )}{a^{2} + 2 \, a b + b^{2}} + \frac{3 \, a + \frac{10 \, a{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac{4 \, b{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac{3 \, a{\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}{{\left (a^{2} + 2 \, a b + b^{2}\right )}{\left (\frac{\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}^{2}}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*sin(d*x+c)^2),x, algorithm="giac")

[Out]

-1/2*(a*log(a - 2*a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 4*b*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + a*(cos
(d*x + c) - 1)^2/(cos(d*x + c) + 1)^2)/(a^2 + 2*a*b + b^2) - 2*a*log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1
) - 1))/(a^2 + 2*a*b + b^2) + (3*a + 10*a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 4*b*(cos(d*x + c) - 1)/(cos(
d*x + c) + 1) + 3*a*(cos(d*x + c) - 1)^2/(cos(d*x + c) + 1)^2)/((a^2 + 2*a*b + b^2)*((cos(d*x + c) - 1)/(cos(d
*x + c) + 1) + 1)^2))/d